//
//  MKTChatMsgTVCellOtherBase.m
//  MKUITestApp
//
//  Created by 苏尚进 on 2021/7/8.
//  Copyright © 2021 moon. All rights reserved.
//

#import "MKTChatMsgTVCellOtherBase.h"

@implementation MKTChatMsgTVCellOtherBase
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.msgUserPicView = [[MKTChatUserPicViewOther alloc] init];
        [self.contentView addSubview:self.msgUserPicView];
    }
    return self;
}
- (void)customLayoutSubviews{
    [super customLayoutSubviews];
}
- (CGSize)customSizeThatFits:(CGSize)size{
    return CGSizeMake(size.width, 44);
}
- (void)customReloadCellModel{
    [super customReloadCellModel];
    MKTChatMsgBase *msg = self.cellModel.modelValue;
    MKTChatUser *user = msg.sender;
    self.msgUserPicView.image = user.picImage;
}
+ (UIEdgeInsets)contentInsets{
    return UIEdgeInsetsMake(5, 20, 20, 55);
}
@end

@implementation MKTChatMsgTVCellOtherTextBubbleBase
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        //
        self.msgTextBubbleView = [[MKTChatTextBubbleViewOther alloc] init];
        self.msgTextBubbleView.fixWidth = YES;
        [self.contentView addSubview:self.msgTextBubbleView];
        //
        self.msgTextBubbleLayout = [[MKUIFlowLayoutConstraint alloc] initWithItems:@[self.msgUserPicView,self.msgTextBubbleView] constraintParam:(MKUIFlowLayoutConstraintParam_H_T_L) contentInsets:self.class.contentInsets interitemSpacing:5];
    }
    return self;
}

@end
